/**
 * Chassis is the framework on which the go engine and interface sit.
 * The idea is to develop the engine and interface as swappable modules
 */
class Engine {

	private final static String NAME = "Pebble Go";
	private final static String VERSION = "0.0.1";

	// the size of the board (assuming a square 2d bord, for now)
	int boardsize;
	
	// array to hold board
	int[][] board;
	
	/** game details **/
	int handicap = 0; // assume even game unless told otherwise
	int komi = 0; // assume zero komi unless told otherwise
	
	private final static int EMPTY = -1; // on a new empty board, points will be EMPTY
	private final static int BLACK = 0;
	private final static int WHITE = 1;
	private final static int KO_CAPTURE = 2; // not sure if needed or even a good idea
	
	/** GETTERS **/
	
	public String getName() {
		return NAME;
	}
	
	public String getVersion() {
		return VERSION;
	}
	
	/** SETTERS **/
	
	public void setBoardsize(int size) {
		boardsize = size;
	}
	
	// this should eventually take in a game in progress and populate the board accordingly
	public void populateBoard() {
	}
	
	// fille the current sized board with null
	// probably quicker to make a new array of size boardsize
	public void clearBoard() {
	}
	
	// this will generate a move for the current board, update the current game, and return the move
	public int[] play() {
		
		// use generateMove to generate a move
		int[] currentMove = generateMove();
		
		// update the board to apply the move
		// handle any captures, etc
		
		// return the move that was just played
		return currentMove;
	}
	
	// this will generate a move for the current board and return the move,
	// but not actually apply it to the current game
	public int[] generateMove() {
		int [] currentMove = null;
		// generate a random coordinate based on board size
		// check if it is occupied
		// check if it's a legal move (suicide, ko, etc)
		// return the move that was generated
		return currentMove;
	}

	// check whether the specified point is occupied
	private boolean isOccupied(int[] point) {
		if (point == null) {
			return false;
		}
		return true;
	}

}